home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6445 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  689 b 

  1. Path: news.PBI.net!usenet
  2. From: mich@pbinet.com
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to tell if a file exists in C
  5. Date: 24 Feb 1996 21:55:20 GMT
  6. Organization: Pacific Bell Internet Services
  7. Message-ID: <4go1g8$qg3@SNFC21_SRVR_WWW.PBI.net>
  8. References: <4eqkj6$ipo@charm.magnus.acs.ohio-state.edu> <m2pwbuvfb9.fsf@hawk.no>
  9. Reply-To: mich@pbinet.com
  10. NNTP-Posting-Host: ppp-5-9.rdcy01.pbinet.com
  11. X-Newsreader: IBM NewsReader/2 v1.03
  12.  
  13. > : Hi, how do I find out if a file already exists
  14. > : in UNIX C? On PCs I would do a findfirst/findnext,
  15. > : is there an equivalent on Unix?
  16.  
  17. >Use the stat function, e.g.:
  18.  
  19. One could also simply open() the file for read-only and check the return code.
  20.  
  21.